<!DOCTYPE HTML>
<html  lang="zh" xmlns:th="http://www.thymeleaf.org">
<meta charset="utf-8">
<head th:include="include :: header"></head>
<body class="white-bg bgys">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content bgystz">
        <form class="form-horizontal m" id="form-economize-edit" th:object="${economize}">
            <input id="id" name="id" th:field="*{id}"  type="hidden">
			<input id="pointId" name="pointId" th:field="*{pointId}"  type="hidden">
			<input id="basicsId" name="basicsId" th:field="*{basicsId}"  type="hidden">
			<!--<div class="form-group">
				<label class="col-sm-3 control-label">计量点名称：</label>
				<div class="col-sm-8">
					<input id="pointName" name="pointName" th:field="*{pointName}" class="form-control" type="text">
				</div>
			</div>
			<div class="form-group">	
				<label class="col-sm-3 control-label">计量点ID：</label>
				<div class="col-sm-8">
					<input id="pointId" name="pointId" th:field="*{pointId}" class="form-control" type="text">
				</div>
			</div>
			<div class="form-group">	
				<label class="col-sm-3 control-label">录入基础ID：</label>
				<div class="col-sm-8">
					<input id="basicsId" name="basicsId" th:field="*{basicsId}" class="form-control" type="text">
				</div>
			</div>-->
			<div class="col-md-3" th:hidden="${month!='丰'}">
				<div class="form-group">
					<label class="col-sm-4 control-label bgys"><label class="spty">*</label>峰段：</label>
					<div class="col-sm-8">
						<input id="fF" name="fF" th:field="*{fF}" class="form-control tx" type="text">
					</div>
				</div>
			</div>
			<div class="col-md-3" th:hidden="${month!='丰'}">
				<div class="form-group">
					<label class="col-sm-4 control-label bgys"><label class="spty">*</label>平段：</label>
					<div class="col-sm-8">
						<input id="fP" name="fP" th:field="*{fP}" class="form-control tx" type="text">
					</div>
				</div>
			</div>
			<div class="col-md-3" th:hidden="${month!='丰'}">
				<div class="form-group">
					<label class="col-sm-4 control-label bgys"><label class="spty">*</label>谷段：</label>
					<div class="col-sm-8">
						<input id="fG" name="fG" th:field="*{fG}" class="form-control tx" type="text">
					</div>
				</div>
			</div>
			<div class="col-md-3" th:hidden="${month!='丰'}">
				<div class="form-group">
					<label class="col-sm-4 control-label bgys">小计：</label>
					<div class="col-sm-8">
						<input id="fTotal" name="fTotal" th:field="*{fTotal}"
							   class="form-control srk" type="text" readonly="true">
					</div>
				</div>
			</div>
			<div class="col-md-3" th:hidden="${month!='平'}">
				<div class="form-group">
					<label class="col-sm-4 control-label bgys"><label class="spty">*</label>平水期电量峰段：</label>
					<div class="col-sm-8">
						<input id="pF" name="pF" th:field="*{pF}" class="form-control tx" type="text">
					</div>
				</div>
			</div>
			<div class="col-md-3" th:hidden="${month!='平'}">
				<div class="form-group">
					<label class="col-sm-4 control-label bgys"><label class="spty">*</label>平段：</label>
					<div class="col-sm-8">
						<input id="pP" name="pP" th:field="*{pP}" class="form-control tx" type="text">
					</div>
				</div>
			</div>
			<div class="col-md-3" th:hidden="${month!='平'}">
				<div class="form-group">
					<label class="col-sm-4 control-label bgys"><label class="spty">*</label>谷段：</label>
					<div class="col-sm-8">
						<input id="pG" name="pG" th:field="*{pG}" class="form-control tx" type="text">
					</div>
				</div>
			</div>
			<div class="col-md-3" th:hidden="${month!='平'}">
				<div class="form-group">
					<label class="col-sm-4 control-label bgys">小计：</label>
					<div class="col-sm-8">
						<input id="pTotal" name="pTotal" th:field="*{pTotal}"
							   class="form-control srk" type="text" readonly="true">
					</div>
				</div>
			</div>
			<div class="col-md-3" th:hidden="${month!='枯'}">
				<div class="form-group">
					<label class="col-sm-4 control-label bgys"><label class="spty">*</label>峰段：</label>
					<div class="col-sm-8">
						<input id="kF" name="kF" th:field="*{kF}" class="form-control tx" type="text">
					</div>
				</div>
			</div>
			<div class="col-md-3" th:hidden="${month!='枯'}">
				<div class="form-group">
					<label class="col-sm-4 control-label bgys"><label class="spty">*</label>平段：</label>
					<div class="col-sm-8">
						<input id="kP" name="kP" th:field="*{kP}" class="form-control tx" type="text">
					</div>
				</div>
			</div>
			<div class="col-md-3" th:hidden="${month!='枯'}">
				<div class="form-group">
					<label class="col-sm-4 control-label bgys"><label class="spty">*</label>谷段：</label>
					<div class="col-sm-8">
						<input id="kG" name="kG" th:field="*{kG}" class="form-control tx" type="text">
					</div>
				</div>
			</div>
			<div class="col-md-3" th:hidden="${month!='枯'}">
				<div class="form-group">
					<label class="col-sm-4 control-label bgys">小计：</label>
					<div class="col-sm-8">
						<input id="kTotal" name="kTotal" th:field="*{kTotal}"
							   class="form-control srk" type="text" readonly="true">
					</div>
				</div>
			</div>

			<div class="col-md-3">
			</div>
			<div class="col-md-3">
			</div>
			<div class="col-md-3">
			</div>


			<div class="col-md-3" style="display:none;">
				<div class="form-group">
					<label class="col-sm-4 control-label bgys">电量合计：</label>
					<div class="col-sm-8">
						<input id="eleTotal" name="eleTotal" th:field="*{eleTotal}"
							   class="form-control srk" type="text" readonly="true">
					</div>
				</div>
			</div>
			<div class="col-md-12">
				<hr style="height:1px;border:none;border-top:1px solid #555555;"/>
			</div>

			<div class="col-md-4">
				<div class="form-group">
					<label class="col-sm-4 control-label bgys"><label class="spty">*</label>电量电厂交易价格：</label>
					<div class="col-sm-8">
						<input id="factoryPrice" name="factoryPrice" th:field="*{factoryPrice}"
							   class="form-control tx" type="text" >
					</div>
				</div>
			</div>

			<div class="col-md-4">
				<div class="form-group">
					<label class="col-sm-4 control-label bgys">电量上网电费：</label>
					<div class="col-sm-8">
						<input id="upAccount" name="upAccount" th:field="*{upAccount}"
							   class="form-control srk" type="text" readonly="true">
					</div>
				</div>
			</div>

			<div class="col-md-4">
			</div>
			<div class="col-md-12">
			</div>

			<div class="col-md-4">
				<div class="form-group">
					<label class="col-sm-4 control-label bgys"><label class="spty">*</label>输配电价：</label>
					<div class="col-sm-8">
						<input id="sPPrice" name="sPPrice" th:field="*{sPPrice}"
							   class="form-control tx" type="text" >
					</div>
				</div>
			</div>

			<div class="col-md-4">
				<div class="form-group">
					<label class="col-sm-4 control-label bgys">输配收入金额：</label>
					<div class="col-sm-8">
						<input id="sPAccount" name="sPAccount" th:field="*{sPAccount}"
							   class="form-control srk" type="text" readonly="true">
					</div>
				</div>
			</div>

			<div class="col-md-4">
			</div>
			<div class="col-md-12">
			</div>

			<div class="col-md-4">
				<div class="form-group">
					<label class="col-sm-4 control-label bgys"><label class="spty">*</label>基金均价：</label>
					<div class="col-sm-8">
						<input id="jJAverage" name="jJAverage" th:field="*{jJAverage}"
							   class="form-control tx" type="text" >
					</div>
				</div>
			</div>

			<div class="col-md-4">
				<div class="form-group">
					<label class="col-sm-4 control-label bgys">基金金额：</label>
					<div class="col-sm-8">
						<input id="jJAccount" name="jJAccount" th:field="*{jJAccount}"
							   class="form-control srk" type="text" readonly="true">
					</div>
				</div>
			</div>

			<div class="col-md-4">
			</div>
			<div class="col-md-12">
			</div>

			<div class="col-md-4">
				<div class="form-group">
					<label class="col-sm-4 control-label bgys">到户均价：</label>
					<div class="col-sm-8">
						<input id="dHAverage" name="dHAverage" th:field="*{dHAverage}"
							   class="form-control srk" type="text" readonly="true">
					</div>
				</div>
			</div>

			<div class="col-md-4">
				<div class="form-group">
					<label class="col-sm-4 control-label bgys">电费金额：</label>
					<div class="col-sm-8">
						<input id="eleAccount" name="eleAccount" th:field="*{eleAccount}"
							   class="form-control srk" type="text" readonly="true">
					</div>
				</div>
			</div>

			<div class="col-md-4">
				<a class="btn btn-success" onclick="submitHandler()">
					<i class="fa fa-hand-peace-o"></i> 计算
				</a>
			</div>
		</form>
    </div>
    <div th:include="include::footer"></div>
    <script type="text/javascript">
		var prefix = ctx + "service/economize"
		$("#form-economize-edit").validate({
			rules:{
                fF:{
					required:true,
				},
                fP:{
                    required:true,
                },
                fG:{
                    required:true,
                },
                pF:{
                    required:true,
                },
                pP:{
                    required:true,
                },
                pG:{
                    required:true,
                },
                kF:{
                    required:true,
                },
                kP:{
                    required:true,
                },
                kG:{
                    required:true,
                },
                factoryPrice:{
                    required:true,
                },
                sPPrice:{
                    required:true,
                },
                jJAverage:{
                    required:true,
                },

			}
		});
		
		function submitHandler() {
	        if ($.validate.form()) {
	            $.operate.saveAndRefer(prefix + "/edit", $('#form-economize-edit').serialize());
	        }
	    }
	</script>
</body>
</html>
